fix: retry truncated provider streams - #39473
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one potentially related PR: Related PR:
The current PR (39473) is specifically about handling AI SDK fallback finishes without provider finish reasons as retryable failures. The search results also show #26167 which dealt with stream truncations, but that appears to be older legacy work. I did not find any exact duplicate PRs that are addressing the same issue (#37852) that your PR targets. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
🤖 Generated with [OpenCode](https://opencode.ai) (GPT-5)
e41f17c to
27e6cd0
Compare
|
Skipping Bugbot: Bugbot could not find a matching SCM installation for this repository. Please reinstall the GitHub/GitLab installation and/or remove the installation from non-Bugbot accounts. Visit the Bugbot dashboard to update your settings. |
|
Quick update: a colleague of mine played with this patched version for a while, and he confirmed that the issue is resolved for him. |
Issue for this PR
Closes #37852
Type of change
What does this PR do?
AI SDK synthesizes an
otherfinish when a provider stream ends without a finish reason. OpenCode treated that as a completedunknownresponse, so a subagent could return an empty successful task result. This change converts that synthetic finish into a retryable stream error. It also propagates child assistant errors through the task tool, so retry exhaustion cannot become an empty success.How did you verify your code works?
Screenshots / recordings
Not applicable: runtime-only change.
Checklist